import { createWebHistory, createRouter } from 'vue-router'
import Login from "../views/Login.vue"
import Home from "../views/Home.vue"
import Callback from '../views/Callback.vue'
import UPloads from '../views/UPloads.vue'
import MY from '../views/MY.vue'
import Settings from '../views/Settings.vue'
import Goods from '../views/Goods.vue'
import Detail from '../views/Detail.vue'
import test from '../views/test.vue'
import test2 from '../views/test2.vue'
import Search from '../views/Search.vue'
import Message from '../views/Message.vue'
import Add from '../views/Add.vue'
import Cart from '../views/Cart.vue'
import Success from '../views/Success.vue'
import OrderDeta from '../views/OrderDeta.vue'
import User from '../views/User.vue'
import Customer from '../views/Customer.vue'
import Admin_login from '../views/Admin_login.vue'
import Admin from '../views/Admin.vue'
import Work from '../views/Work.vue'
import Workstation from '../views/Workstation.vue'
import Rest from '../views/Rest.vue'
import Review from '../views/Review.vue'
import Vacation from '../views/Vacation.vue'

const routes = [
    {
        path:"/",
        component:Home
    },
    {
        path:"/login",
        component:Login
    },
    {
        path:"/callback",
        component:Callback
    },
    {
        path:"/uploads",
        component:UPloads
    },
    {
        path:"/my",
        component:MY
    },
    {
        path:"/settings",
        component:Settings
    },
    {
        path:"/goods",
        component:Goods
    },
    {
        path:"/deta",
        component:Detail
    },
    {
        path:"/search",
        component:Search
    },
    {
        path:"/message",
        component:Message
    },
    {
        path:"/add",
        component:Add
    },
    {
        path:"/addcart",
        component:Cart
    },
    {
        path:"/success",
        component:Success
    },
    {
        path:"/orderdeta",
        component:OrderDeta
    },
    {
        path:"/user",
        component:User
    },
    {
        path:"/customer",
        component:Customer
    },
    {
        path:"/test",
        component:test
    },
    {
        path:"/test2",
        component:test2
    },
    {
        path:"/alogin",
        component:Admin_login
    },
    {
        path:"/admin",
        component:Admin
    },
    {
        path:"/work",
        component:Work
    },
    {
        path:"/works",
        component:Workstation
    },
    {
        path:"/rest",
        component:Rest
    },
    {
        path:"/review",
        component:Review
    },
    {
        path:"/vacation",
        component:Vacation
    },
    // {
    //     path:"/",
    //     redirect:"/register"
    // }
]

// 将创建的配置关系挂载到router实例上
const router =createRouter({
    history:createWebHistory(),
    routes
})

export default router